const express = require('express');
const router = express.Router();
const CommentController = require('../controllers/commentController');
const { requireAuth } = require('../middleware/auth');

// 获取新闻的评论列表
router.get('/news/:newsId', CommentController.getComments);

// 创建评论
router.post('/', requireAuth, CommentController.createComment);

// 删除评论
router.delete('/:id', requireAuth, CommentController.deleteComment);

// 点赞评论
router.post('/:id/like', requireAuth, CommentController.likeComment);

module.exports = router; 